home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Fixation 1.3 / dnr.c < prev    next >
Text File  |  1995-09-17  |  17KB  |  544 lines

  1. /*
  2.     DNR.c - DNR library for MPW
  3.  
  4.     © Copyright 1988 by Apple Computer.  All rights reserved.
  5.     PowerPC corrections by Eric Scouten, December 2, 1994.
  6.  
  7. */
  8.  
  9. #define MPW3.0
  10.  
  11. #include <OSUtils.h>
  12. #include <Errors.h>
  13. #include <Files.h>
  14. #include <Resources.h>
  15. #include <Memory.h>
  16. #include <Traps.h>
  17. #include <Gestalt.h>
  18. #include <Folders.h>
  19. #include <MixedMode.h>
  20.  
  21. #pragma require_prototypes off
  22. #pragma cplusplus off
  23.  
  24.  
  25. #define OPENRESOLVER    1L
  26. #define CLOSERESOLVER   2L
  27. #define STRTOADDR       3L
  28. #define ADDRTOSTR       4L
  29. #define ENUMCACHE       5L
  30. #define ADDRTONAME      6L
  31. #define HINFO           7L
  32. #define MXINFO          8L
  33.  
  34. Handle              codeHndl = nil;
  35. UniversalProcPtr    dnr = nil;
  36.  
  37.  
  38. TrapType GetTrapType(theTrap)
  39. unsigned long theTrap;
  40. {
  41.     if (BitAnd(theTrap, 0x0800) > 0)
  42.         return(ToolTrap);
  43.     else
  44.         return(OSTrap);
  45.     }
  46.  
  47. Boolean TrapAvailable(trap)
  48. unsigned long trap;
  49. {
  50. TrapType trapType = ToolTrap;
  51. unsigned long numToolBoxTraps;
  52.  
  53.     if (NGetTrapAddress(_InitGraf, ToolTrap) == NGetTrapAddress(0xAA6E, ToolTrap))
  54.         numToolBoxTraps = 0x200;
  55.     else
  56.         numToolBoxTraps = 0x400;
  57.  
  58.     trapType = GetTrapType(trap);
  59.     if (trapType == ToolTrap) {
  60.         trap = BitAnd(trap, 0x07FF);
  61.         if (trap >= numToolBoxTraps)
  62.             trap = _Unimplemented;
  63.         }
  64.     return(NGetTrapAddress(trap, trapType) != NGetTrapAddress(_Unimplemented, ToolTrap));
  65.  
  66. }
  67.  
  68. void GetSystemFolder(short *vRefNumP, long *dirIDP)
  69. {
  70.     SysEnvRec info;
  71.     long wdProcID;
  72.  
  73.     SysEnvirons(1, &info);
  74.     if (GetWDInfo(info.sysVRefNum, vRefNumP, dirIDP, &wdProcID) != noErr) {
  75.         *vRefNumP = 0;
  76.         *dirIDP = 0;
  77.         }
  78.     }
  79.  
  80. void GetCPanelFolder(short *vRefNumP, long *dirIDP)
  81. {
  82.     Boolean hasFolderMgr = false;
  83.     long feature;
  84.  
  85.     if (Gestalt(gestaltFindFolderAttr, &feature) == noErr)
  86.         hasFolderMgr = true;
  87.     if (!hasFolderMgr) {
  88.         GetSystemFolder(vRefNumP, dirIDP);
  89.         return;
  90.         }
  91.     else {
  92.         if (FindFolder(kOnSystemDisk, kControlPanelFolderType, kDontCreateFolder, vRefNumP, dirIDP) != noErr) {
  93.             *vRefNumP = 0;
  94.             *dirIDP = 0;
  95.             }
  96.         }
  97.     }
  98.  
  99. /* SearchFolderForDNRP is called to search a folder for files that might
  100.     contain the 'dnrp' resource */
  101. short SearchFolderForDNRP(long targetType, long targetCreator, short vRefNum, long dirID)
  102. {
  103.     HParamBlockRec fi;
  104.     Str255 filename;
  105.     short refnum;
  106.  
  107.     fi.fileParam.ioCompletion = nil;
  108.     fi.fileParam.ioNamePtr = filename;
  109.     fi.fileParam.ioVRefNum = vRefNum;
  110.     fi.fileParam.ioDirID = dirID;
  111.     fi.fileParam.ioFDirIndex = 1;
  112.  
  113.     while (PBHGetFInfo(&fi, false) == noErr) {
  114.         /* scan system folder for driver resource files of specific type & creator */
  115.         if (fi.fileParam.ioFlFndrInfo.fdType == targetType &&
  116.             fi.fileParam.ioFlFndrInfo.fdCreator == targetCreator) {
  117.             /* found the MacTCP driver file? */
  118.             refnum = HOpenResFile(vRefNum, dirID, filename, fsRdPerm);
  119.             if (GetIndResource('dnrp', 1) == NULL)
  120.                 CloseResFile(refnum);
  121.             else
  122.                 return refnum;
  123.             }
  124.         /* check next file in system folder */
  125.         fi.fileParam.ioFDirIndex++;
  126.         fi.fileParam.ioDirID = dirID;   /* PBHGetFInfo() clobbers ioDirID */
  127.         }
  128.     return(-1);
  129.     }
  130.  
  131.  
  132.  
  133. /* OpenOurRF is called to open the MacTCP driver resources */
  134.  
  135. short OpenOurRF()
  136. {
  137.     short refnum;
  138.     short vRefNum;
  139.     long dirID;
  140.  
  141.     /* first search Control Panels for MacTCP 1.1 */
  142.     GetCPanelFolder(&vRefNum, &dirID);
  143.     refnum = SearchFolderForDNRP('cdev', 'ztcp', vRefNum, dirID);
  144.     if (refnum != -1) return(refnum);
  145.  
  146.     /* next search System Folder for MacTCP 1.0.x */
  147.     GetSystemFolder(&vRefNum, &dirID);
  148.     refnum = SearchFolderForDNRP('cdev', 'mtcp', vRefNum, dirID);
  149.     if (refnum != -1) return(refnum);
  150.  
  151.     /* finally, search Control Panels for MacTCP 1.0.x */
  152.     GetCPanelFolder(&vRefNum, &dirID);
  153.     refnum = SearchFolderForDNRP('cdev', 'mtcp', vRefNum, dirID);
  154.     if (refnum != -1) return(refnum);
  155.  
  156.     return -1;
  157.     }
  158.  
  159.  
  160.  
  161.  
  162. typedef OSErr (*OpenResolverProcPtr)(long selector, char* fileName);
  163.  
  164. enum {
  165.     uppOpenResolverProcInfo = kCStackBased
  166.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  167.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  168.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
  169. };
  170.  
  171. #if USESROUTINEDESCRIPTORS
  172. typedef UniversalProcPtr OpenResolverUPP;
  173.  
  174. #define NewOpenResolverProc(userRoutine)                        \
  175.         (OpenResolverUPP) NewRoutineDescriptor(userRoutine, uppOpenResolverProcInfo, GetCurrentISA())
  176. #define CallOpenResolverProc(userRoutine, selector, filename)   \
  177.         CallUniversalProc(userRoutine, uppOpenResolverProcInfo, selector, filename)
  178. #else
  179. typedef OpenResolverProcPtr OpenResolverUPP;
  180.  
  181. #define NewOpenResolverProc(userRoutine)                    \
  182.         (OpenResolverUPP)(userRoutine)
  183. #define CallOpenResolverProc(userRoutine, selector, filename)   \
  184.         (*userRoutine)(selector, filename)
  185. #endif
  186.  
  187.  
  188.  
  189. pascal OSErr OpenResolver(fileName)
  190. char *fileName;
  191. {
  192.     short           refnum;
  193.     OSErr           rc;
  194.  
  195.     if (dnr != nil)
  196.         /* resolver already loaded in */
  197.         return(noErr);
  198.  
  199.     /* open the MacTCP driver to get DNR resources. Search for it based on
  200.        creator & type rather than simply file name */
  201.     refnum = OpenOurRF();
  202.  
  203.     /* ignore failures since the resource may have been installed in the
  204.        System file if running on a Mac 512Ke */
  205.  
  206.     /* load in the DNR resource package */
  207.     codeHndl = GetIndResource('dnrp', 1);
  208.     if (codeHndl == nil) {
  209.         /* can't open DNR */
  210.         return(ResError());
  211.     }
  212.  
  213.     DetachResource(codeHndl);
  214.     if (refnum != -1) {
  215.         CloseResFile(refnum);
  216.     }
  217.  
  218.     /* lock the DNR resource since it cannot be reloated while opened */
  219.     HLock(codeHndl);
  220.     dnr = (UniversalProcPtr) *codeHndl;
  221.  
  222.     /* call open resolver */
  223.     rc = CallOpenResolverProc((OpenResolverUPP) dnr, OPENRESOLVER, fileName);
  224.     if (rc != noErr) {
  225.         /* problem with open resolver, flush it */
  226.         HUnlock(codeHndl);
  227.         DisposHandle(codeHndl);
  228.         dnr = nil;
  229.     }
  230.     return(rc);
  231. }
  232.  
  233.  
  234.  
  235. typedef OSErr (*CloseResolverProcPtr)(long selector);
  236.  
  237. enum {
  238.     uppCloseResolverProcInfo = kCStackBased
  239.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  240.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  241. };
  242.  
  243. #if USESROUTINEDESCRIPTORS
  244. typedef UniversalProcPtr CloseResolverUPP;
  245.  
  246. #define NewCloseResolverProc(userRoutine)                       \
  247.         (CloseResolverUPP) NewRoutineDescriptor(userRoutine, uppCloseResolverProcInfo, GetCurrentISA())
  248. #define CallCloseResolverProc(userRoutine, selector)    \
  249.         CallUniversalProc(userRoutine, uppCloseResolverProcInfo, selector)
  250. #else
  251. typedef CloseResolverProcPtr CloseResolverUPP;
  252.  
  253. #define NewCloseResolverProc(userRoutine)                       \
  254.         (CloseResolverUPP)(userRoutine)
  255. #define CallCloseResolverProc(userRoutine, selector)    \
  256.         (*userRoutine)(selector)
  257. #endif
  258.  
  259.  
  260.  
  261. pascal OSErr CloseResolver()
  262. {
  263.     if (dnr == nil)
  264.         /* resolver not loaded error */
  265.         return(notOpenErr);
  266.  
  267.     /* call close resolver */
  268.     CallCloseResolverProc((CloseResolverUPP) dnr, CLOSERESOLVER);
  269.  
  270.     /* release the DNR resource package */
  271.     HUnlock(codeHndl);
  272.     DisposHandle(codeHndl);
  273.     dnr = nil;
  274.     return(noErr);
  275. }
  276.  
  277.  
  278.  
  279.  
  280. typedef OSErr (*StrToAddrProcPtr)(long selector, char* hostName, struct hostInfo* rtnStruct,
  281.                                     long resultProc, char* userData);
  282.  
  283. enum {
  284.     uppStrToAddrProcInfo = kCStackBased
  285.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  286.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  287.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
  288.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct hostInfo *)))
  289.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  290.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char *)))
  291. };
  292.  
  293. #if USESROUTINEDESCRIPTORS
  294. typedef UniversalProcPtr StrToAddrUPP;
  295.  
  296. #define NewStrToAddrProc(userRoutine)                       \
  297.         (StrToAddrUPP) NewRoutineDescriptor(userRoutine, uppStrToAddrProcInfo, GetCurrentISA())
  298. #define CallStrToAddrProc(userRoutine, selector, hostName, rtnStruct, resultProc, userData) \
  299.         CallUniversalProc(userRoutine, uppStrToAddrProcInfo, selector, hostName, rtnStruct, resultProc, userData)
  300. #else
  301. typedef StrToAddrProcPtr StrToAddrUPP;
  302.  
  303. #define NewStrToAddrProc(userRoutine)                       \
  304.         (StrToAddrUPP)(userRoutine)
  305. #define CallStrToAddrProc(userRoutine, selector, hostName, rtnStruct, resultProc, userData) \
  306.         (*userRoutine)(selector, hostName, rtnStruct, resultProc, userData)
  307. #endif
  308.  
  309.  
  310.  
  311. pascal OSErr StrToAddr(hostName, rtnStruct, resultproc, userDataPtr)
  312. char *hostName;
  313. struct hostInfo *rtnStruct;
  314. long resultproc;
  315. char *userDataPtr;
  316. {
  317.     if (dnr == nil)
  318.         /* resolver not loaded error */
  319.         return(notOpenErr);
  320.  
  321.     return(CallStrToAddrProc((StrToAddrUPP) dnr, STRTOADDR, hostName, (void*) rtnStruct,
  322.                             resultproc, userDataPtr));
  323. }
  324.  
  325.  
  326. typedef OSErr (*AddrToStrProcPtr)(long selector, long address, char* hostName);
  327.  
  328. enum {
  329.     uppAddrToStrProcInfo = kCStackBased
  330.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  331.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  332.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  333.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(char *)))
  334. };
  335.  
  336. #if USESROUTINEDESCRIPTORS
  337. typedef UniversalProcPtr AddrToStrUPP;
  338.  
  339. #define NewAddrToStrProc(userRoutine)                       \
  340.         (AddrToStrUPP) NewRoutineDescriptor(userRoutine, uppAddrToStrProcInfo, GetCurrentISA())
  341. #define CallAddrToStrProc(userRoutine, selector, address, hostName) \
  342.         CallUniversalProc(userRoutine, uppAddrToStrProcInfo, selector, address, hostName)
  343. #else
  344. typedef AddrToStrProcPtr AddrToStrUPP;
  345.  
  346. #define NewAddrToStrProc(userRoutine)                       \
  347.         (AddrToStrUPP)(userRoutine)
  348. #define CallAddrToStrProc(userRoutine, selector, address, hostName) \
  349.         (*userRoutine)(selector, address, hostName)
  350. #endif
  351.  
  352.  
  353. pascal OSErr AddrToStr(addr, addrStr)
  354. unsigned long addr;
  355. char *addrStr;
  356. {
  357.     if (dnr == nil)
  358.         /* resolver not loaded error */
  359.         return(notOpenErr);
  360.  
  361.     CallAddrToStrProc((AddrToStrUPP) dnr, ADDRTOSTR, addr, addrStr);
  362.  
  363.     return(noErr);
  364. }
  365.  
  366.  
  367.  
  368. typedef OSErr (*EnumCacheProcPtr)(long selector, long result, char* userData);
  369.  
  370. enum {
  371.     uppEnumCacheProcInfo = kCStackBased
  372.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  373.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  374.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  375.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(char *)))
  376. };
  377.  
  378. #if USESROUTINEDESCRIPTORS
  379. typedef UniversalProcPtr EnumCacheUPP;
  380.  
  381. #define NewEnumCacheProc(userRoutine)                       \
  382.         (EnumCacheUPP) NewRoutineDescriptor(userRoutine, uppEnumCacheProcInfo, GetCurrentISA())
  383. #define CallEnumCacheProc(userRoutine, selector, result, userData)  \
  384.         CallUniversalProc(userRoutine, uppEnumCacheProcInfo, selector, result, userData)
  385. #else
  386. typedef EnumCacheProcPtr EnumCacheUPP;
  387.  
  388. #define NewEnumCacheProc(userRoutine)                       \
  389.         (EnumCacheUPP)(userRoutine)
  390. #define CallEnumCacheProc(userRoutine, selector, result, userData)  \
  391.         (*userRoutine)(selector, result, userData)
  392. #endif
  393.  
  394.  
  395.  
  396. pascal OSErr EnumCache(resultproc, userDataPtr)
  397. long resultproc;
  398. char *userDataPtr;
  399. {
  400.     if (dnr == nil)
  401.         /* resolver not loaded error */
  402.         return(notOpenErr);
  403.  
  404.     return(CallEnumCacheProc((EnumCacheUPP) dnr, ENUMCACHE, resultproc, userDataPtr));
  405. }
  406.  
  407.  
  408.  
  409. typedef OSErr (*AddrToNameProcPtr)(long selector, unsigned long addr, struct hostInfo* rtnStruct,
  410.                                     long resultProc, char* userData);
  411.  
  412. enum {
  413.     uppAddrToNameProcInfo = kCStackBased
  414.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  415.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  416.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  417.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct hostInfo *)))
  418.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  419.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char *)))
  420.  
  421. };
  422.  
  423. #if USESROUTINEDESCRIPTORS
  424. typedef UniversalProcPtr AddrToNameUPP;
  425.  
  426. #define NewAddrToNameProc(userRoutine)                      \
  427.         (AddrToNameUPP) NewRoutineDescriptor(userRoutine, uppAddrToNameProcInfo, GetCurrentISA())
  428. #define CallAddrToNameProc(userRoutine, selector, addr, rtnStruct, resultProc, userData)    \
  429.         CallUniversalProc(userRoutine, uppAddrToNameProcInfo, selector, addr, rtnStruct, resultProc, userData)
  430. #else
  431. typedef AddrToNameProcPtr AddrToNameUPP;
  432.  
  433. #define NewAddrToNameProc(userRoutine)                      \
  434.         (AddrToNameUPP)(userRoutine)
  435. #define CallAddrToNameProc(userRoutine, selector, addr, rtnStruct, resultProc, userData)    \
  436.         (*userRoutine)(selector, addr, rtnStruct, resultProc, userData)
  437. #endif
  438.  
  439.  
  440.  
  441. pascal OSErr AddrToName(addr, rtnStruct, resultproc, userDataPtr)
  442. unsigned long addr;
  443. struct hostInfo *rtnStruct;
  444. long resultproc;
  445. char *userDataPtr;
  446. {
  447.     if (dnr == nil)
  448.         /* resolver not loaded error */
  449.         return(notOpenErr);
  450.  
  451.     return(CallAddrToNameProc((AddrToNameUPP) dnr, ADDRTONAME, addr, rtnStruct, resultproc, userDataPtr));
  452. }
  453.  
  454.  
  455. typedef OSErr (*HInfoProcPtr)(long selector, char* hostName, struct returnRec* returnRecPtr,
  456.                                 long resultProc, char* userData);
  457.  
  458. enum {
  459.     uppHInfoProcInfo = kCStackBased
  460.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  461.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  462.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
  463.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct returnRec *)))
  464.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  465.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char *)))
  466.  
  467. };
  468.  
  469. #if USESROUTINEDESCRIPTORS
  470. typedef UniversalProcPtr HInfoUPP;
  471.  
  472. #define NewHInfoProc(userRoutine)                       \
  473.         (HInfoUPP) NewRoutineDescriptor(userRoutine, uppHInfoProcInfo, GetCurrentISA())
  474. #define CallHInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData)  \
  475.         CallUniversalProc(userRoutine, uppHInfoProcInfo, selector, hostName, returnRecPtr, resultProc, userData)
  476. #else
  477. typedef HInfoProcPtr HInfoUPP;
  478.  
  479. #define NewHInfoProc(userRoutine)                       \
  480.         (HInfoUPP)(userRoutine)
  481. #define CallHInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData)  \
  482.         (*userRoutine)(selector, hostName, returnRecPtr, resultProc, userData)
  483. #endif
  484.  
  485. pascal  OSErr HInfo(hostName, returnRecPtr, resultProc, userDataPtr)
  486. char *hostName;
  487. struct returnRec *returnRecPtr;
  488. long resultProc;
  489. char *userDataPtr;
  490. {
  491.     if (dnr == nil)
  492.         /* resolver not loaded error */
  493.         return(notOpenErr);
  494.  
  495.     return(CallHInfoProc((HInfoUPP) dnr, HINFO, hostName, (void*) returnRecPtr,
  496.                         resultProc, userDataPtr));
  497. }
  498.  
  499.  
  500.  
  501. typedef OSErr (*MXInfoProcPtr)(long selector, char* hostName, struct returnRec* returnRecPtr,
  502.                                 long resultProc, char* userData);
  503.  
  504. enum {
  505.     uppMXInfoProcInfo = kCStackBased
  506.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  507.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  508.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *)))
  509.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(struct returnRec *)))
  510.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  511.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char *)))
  512.  
  513. };
  514.  
  515. #if USESROUTINEDESCRIPTORS
  516. typedef UniversalProcPtr MXInfoUPP;
  517.  
  518. #define NewMXInfoProc(userRoutine)                      \
  519.         (MXInfoUPP) NewRoutineDescriptor(userRoutine, uppMXInfoProcInfo, GetCurrentISA())
  520. #define CallMXInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
  521.         CallUniversalProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData)
  522. #else
  523. typedef MXInfoProcPtr MXInfoUPP;
  524.  
  525. #define NewMXInfoProc(userRoutine)                      \
  526.         (MXInfoUPP)(userRoutine)
  527. #define CallMXInfoProc(userRoutine, selector, hostName, returnRecPtr, resultProc, userData) \
  528.         (*userRoutine)(selector, hostName, returnRecPtr, resultProc, userData)
  529. #endif
  530.  
  531.  
  532. pascal  OSErr MXInfo(hostName, returnRecPtr, resultProc, userDataPtr)
  533. char *hostName;
  534. struct returnRec *returnRecPtr;
  535. long resultProc;
  536. char *userDataPtr;
  537. {
  538.     if (dnr == nil)
  539.         /* resolver not loaded error */
  540.         return(notOpenErr);
  541.  
  542.     return(CallMXInfoProc((MXInfoUPP) dnr, MXINFO, hostName, returnRecPtr, resultProc, userDataPtr));
  543. }
  544.